
import Vue from 'vue';
import Router from 'vue-router';
let routes = [
    {
        path: '/',
        redirect: {
            name: 'indexMain'
        }
    },
    {
        path: '/indexMain',
        name: 'indexMain',
        component: (solve) => require(['@/views/index'], solve)
    },
    // 未配置的路由跳到404页面
    {
        path: '*',
        redirect: '/notFound'
    }
];

const originalPush = Router.prototype.push;

const originalReplace = Router.prototype.replace;

Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch((err) => err);
};

Router.prototype.replace = function replace(location) {
    return originalReplace.call(this, location).catch((err) => err);
};

Vue.use(Router);
const router = new Router({
    routes: routes,
    //   base: "/zk-ui",
    //   mode: "history",
    mode: 'hash'
});

export default router;
